<template>
	<view class="all_order">
		<!-- 已支付 -->
		<view class="yy_order" v-if="orderType == 0">
			
			<view class="yy_top">
				<view class="top_text">待支付</view>
				<view class="top_price">￥ <span>{{data.AO012}}</span></view>
			</view>
			<tm-divider  ></tm-divider>
			<view class="yy_middle">
				<view class="middle_left">
					<view class="middle_left_top_title">
						盲盒·经济型
					</view>
					<view class="middle_left_top_place">
							<view class="">
								<tm-icons name='/static/images/start.png' :size='32'></tm-icons> 
								{{data.AO002}}
							</view>
							<view class="">
								<tm-icons name='/static/images/end.png' :size='32'></tm-icons>
								{{data.AO004}}
							</view>
						</view>
		
				</view>
				<view class="middle_right">
					<tm-avatar src='/static/images/box.png' :size='150'></tm-avatar>
				</view>
			</view>
			<view class="yy_time">
				<view class="time_one">
					{{data.AO003}} {{data.AO008}}
				</view>
				<view class="time_one">
					<tm-divider :text="data.AO011+'天'"></tm-divider>
				</view>
				<view class="time_one">
					{{data.AO005}} {{data.AO009}}
				</view>
			</view>
			<view class="yy_btn">
				<tm-button theme="bg-gradient-orange-accent" :plan='true' :round='10' size='m' @click='doCancel(data.AO010)'>取消订单</tm-button>
				<tm-button theme="bg-gradient-orange-accent" :round='10' size='m' >去取车</tm-button>
			</view>
		</view>

		<!-- 待支付 -->
		<view class="yy_order" v-if="orderType == 1">
			
			<view class="yy_top">
				<view class="top_text">待支付</view>
				<view class="top_price">￥ <span>{{data.AO012}}</span></view>
			</view>
			<tm-divider  ></tm-divider>
			<view class="yy_middle">
				<view class="middle_left">
					<view class="middle_left_top_title">
						盲盒·经济型
					</view>
					<view class="middle_left_top_place">
							<view class="">
								<tm-icons name='/static/images/start.png' :size='32'></tm-icons> 
								{{data.AO002}}
							</view>
							<view class="">
								<tm-icons name='/static/images/end.png' :size='32'></tm-icons>
								{{data.AO004}}
							</view>
						</view>
		
				</view>
				<view class="middle_right">
					<tm-avatar src='/static/images/box.png' :size='150'></tm-avatar>
				</view>
			</view>
			<view class="yy_time">
				<view class="time_one">
					{{data.AO003}} {{data.AO008}}
				</view>
				<view class="time_one">
					<tm-divider :text="data.AO011+'天'"></tm-divider>
				</view>
				<view class="time_one">
					{{data.AO005}} {{data.AO009}}
				</view>
			</view>
			<view class="yy_btn">
				<tm-button theme="bg-gradient-orange-accent" :plan='true' :round='10' size='m' >咨询</tm-button>
				<tm-button theme="bg-gradient-orange-accent" :round='10' size='m' @click='doZF(data.AO010,data.AO012)'>去支付</tm-button>
			</view>
		</view>
		<!-- 租赁中 -->
		<!-- 已完成-->
		<!-- 已取消 -->
		<view class="yy_order" v-if="orderType == 4">
			
			<view class="yy_top">
				<view class="top_text">待支付</view>
				<view class="top_price">￥ <span>{{data.AO012}}</span></view>
			</view>
			<tm-divider  ></tm-divider>
			<view class="yy_middle">
				<view class="middle_left">
					<view class="middle_left_top_title">
						盲盒·经济型
					</view>
					<view class="middle_left_top_place">
							<view class="">
								<tm-icons name='/static/images/start.png' :size='32'></tm-icons> 
								{{data.AO002}}
							</view>
							<view class="">
								<tm-icons name='/static/images/end.png' :size='32'></tm-icons>
								{{data.AO004}}
							</view>
						</view>
		
				</view>
				<view class="middle_right">
					<tm-avatar src='/static/images/box.png' :size='150'></tm-avatar>
				</view>
			</view>
			<view class="yy_time">
				<view class="time_one">
					{{data.AO003}} {{data.AO008}}
				</view>
				<view class="time_one">
					<tm-divider :text="data.AO011+'天'"></tm-divider>
				</view>
				<view class="time_one">
					{{data.AO005}} {{data.AO009}}
				</view>
			</view>
			<view class="yy_btn">
				<!-- <tm-button theme="bg-gradient-orange-accent" :plan='true' :round='10' size='m'>咨询</tm-button> -->
				<tm-button theme="bg-gradient-orange-accent" :round='10' size='m' >再次预定</tm-button>
			</view>
		</view>
		
		<tm-flotbutton color="bg-gradient-orange-accent" :actions='list' size='m' :safe='true' :click-actions-hiden='false' @change='changeone'></tm-flotbutton>
	</view>
</template>

<script>
	export default {
		name:'AllOrder',
		// 接收订单类型
		props:{
			orderType:Number,
			data:{
				type:Object
			}
		},
		data() {
			return {
			    list:[
					{icon:'icon-headset-fill',label:'找客服',color: 'bg-gradient-orange-accent'}
					,{icon:'icon-copy-fill',label:'开发票',color: 'bg-gradient-blue-accent'},
					]
			}
		},
		methods: {
			
			changeone(e){
				console.log(e);
				// e的值为1  跳转开发票页面， e的值为0 跳转客服页面
			},
			doZF(id,price){
				console.log(this.orderType)
				uni.navigateTo({
					url:`/pages/payorder/payorder?orderid=${id}&price=${price}`
				})
			},
			doCancel(AO010){
				this.$emit('cancelOrder',AO010)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.all_order{
		width: 100%;
		height: 100%;
		.yy_order{
			background-color: #ffffff;
			height: 100%;
			width: 85%;
			margin: auto;
			margin-top:20rpx;
			margin-bottom: 20rpx;
			border-radius: 20rpx;
			.yy_top{
			    box-sizing: border-box;
				padding: 20rpx;
				display: flex;
				justify-content: space-between;
				
				.top_text{
					color: #ff8f00;
					font-size: 24rpx;
					font-weight: 550;
				}
				.top_price{
					font-size: 20rpx;
					span{
						font-size: 24rpx;
						font-weight: 600;
					}
				}
			}
			.yy_middle{
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 20rpx;
				.middle_left{
					.middle_left_top_title{
						font-weight: 700;
						font-size: 32rpx;
						margin-bottom: 20rpx;
					}
					.middle_left_top_place{
						font-size: 24rpx;
						font-weight: 600;
						line-height: 50rpx;
					}
				}
			}
			.yy_time{
				display: flex;
				font-size: 22rpx;
				color: #8d8d8d;
				margin-top: 20rpx;
				margin-bottom: 30rpx;
				.time_one{
					text-align: center;
					width: 33%;
				}
			}
			.yy_btn{
				text-align: right;
				padding: 20rpx;
			}
		}
	}
</style>
